Closed
Conversation
This was referenced Feb 15, 2026
include/nbl/builtin/hlsl/concepts/accessors/loadable_image.hlsl
Outdated
Show resolved
Hide resolved
Member
|
Also @Przemog1 you have those to do In
In
In
|
include/nbl/builtin/hlsl/concepts/accessors/loadable_image.hlsl
Outdated
Show resolved
Hide resolved
Comment on lines
74
to
91
| const SplattingParameters::scalar_t baseRootOfStart = splattingParameters.baseRootOfStart(); | ||
| const SplattingParameters::scalar_t rcpLog2Base = splattingParameters.rcpLog2Base(); | ||
| const SplattingParameters::scalar_t luma = splattingParameters.calcLuma<input_sample_type>(_sample); | ||
| const SplattingParameters::scalar_t log2Luma = log2<SplattingParameters::scalar_t>(luma); | ||
| const SplattingParameters::scalar_t log2BaseRootOfStart = log2<SplattingParameters::scalar_t>(baseRootOfStart); | ||
| const SplattingParameters::scalar_t cascade = log2Luma * rcpLog2Base - log2BaseRootOfStart; | ||
| const SplattingParameters::scalar_t lastCascade = cascade_count - 1u; | ||
| const SplattingParameters::scalar_t clampedCascade = clamp(cascade, 0, lastCascade); | ||
| // c<=0 -> 0, c>=Count-1 -> Count-1 | ||
| uint32_t lowerCascadeIndex = floor<cascade_layer_scalar_type>(cascade); | ||
| uint16_t lowerCascadeIndex = uint16_t(floor<SplattingParameters::scalar_t>(clampedCascade)); | ||
| // 0 whenever clamped or `cascade` is integer (when `clampedCascade` is integer) | ||
| cascade_layer_scalar_type higherCascadeWeight = clampedCascade - floor<cascade_layer_scalar_type>(clampedCascade); | ||
| SplattingParameters::scalar_t higherCascadeWeight = clampedCascade - floor<SplattingParameters::scalar_t>(clampedCascade); | ||
| // never 0 thanks to magic of `1-fract(x)` | ||
| cascade_layer_scalar_type lowerCascadeWeight = cascade_layer_scalar_type(1) - higherCascadeWeight; | ||
| SplattingParameters::scalar_t lowerCascadeWeight = SplattingParameters::scalar_t(1) - higherCascadeWeight; | ||
|
|
||
| // handle super bright sample case | ||
| if (cascade > CascadeCount - 1) | ||
| lowerCascadeWeight = exp2(log2Start + log2Base * (CascadeCount - 1) - log2Luma); | ||
| if (cascade > lastCascade) | ||
| lowerCascadeWeight = exp2((log2BaseRootOfStart + lastCascade) / rcpLog2Base - log2Luma); |
Member
There was a problem hiding this comment.
I need this optimized and better splattingParameters members, like this (log2BaseRootOfStart + lastCascade) / rcpLog2Base is essentially a constant
Comment on lines
51
to
52
| retval.Log2BaseRootOfStart = log2<scalar_t>(unpacked[0]); | ||
| retval.BrightSampleLumaBias = (retval.Log2BaseRootOfStart + LastCascade) / retval.RcpLog2Base; |
There was a problem hiding this comment.
no, this is what I want STORED by the CPU, doing any part of this on GPU doesn't help
There was a problem hiding this comment.
basically two more float16 are needed
include/nbl/builtin/hlsl/concepts/accessors/anisotropically_sampled.hlsl
Outdated
Show resolved
Hide resolved
include/nbl/builtin/hlsl/concepts/accessors/anisotropically_sampled.hlsl
Outdated
Show resolved
Hide resolved
include/nbl/builtin/hlsl/concepts/accessors/loadable_image.hlsl
Outdated
Show resolved
Hide resolved
Comment on lines
33
to
38
| int32_t PackedLog2; | ||
|
|
||
| scalar_t rcpLog2Base() | ||
| { | ||
| return unpackedLog2Parameters()[1]; | ||
| } | ||
| // float16_t log2BaseRootOfStart; 2 | ||
| // float16_t brightSampleLumaBias; 3 | ||
| // pack as Half2x16 | ||
| int32_t PackedPrecomputed; |
Contributor
|
Merged into branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
old PR:
#964